import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import store from './store'
import './style/index.css'
import dayjs from 'dayjs'

Vue.use(ElementUI);



const baseURL = "http://122.51.249.55:8083/"
axios.defaults.baseURL = baseURL
    // 拦截器设置请求头
axios.interceptors.request.use(
    function(config) {
        //在请求发出之前进行一些信息设置
        config.headers.token = JSON.parse(localStorage.getItem('userinfo')) ? JSON.parse(localStorage.getItem('userinfo')).token : ''
        return config;
    },
    function(err) {
        // 处理响应的错误信息
    }
)




Vue.config.productionTip = false

Vue.filter('dataFormate', (val, str = "YYYY-MM-DD HH:MM:ss") => {
    return dayjs(val * 1).format(str)
})

Vue.prototype.$axios = axios

new Vue({
    store,
    router,
    render: h => h(App)
}).$mount('#app')